package com.abocode.aichat.client;

import com.abocode.aichat.utils.SystemUtils;

public class TcpClientFactory {
    private  static volatile   TcpClient tcpClient;
    public  static TcpClient  getTcpClient(){
        String domain= SystemUtils.getAddress().getHostAddress();
        if (tcpClient==null){
            tcpClient = new TcpClient(domain, 52222);
        }
          return  tcpClient;
    }

    public  static TcpClient  getTcpClient(String domain,int port){
        if (tcpClient==null){
            tcpClient = new TcpClient(domain, port);
        }
        return  tcpClient;
    }
}
